<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Dreamer Blog - 后台管理系统</title> 
    <link rel="icon" href="/resource/img/favicon.ico" type="image/x-icon" />
    <!-- bootstrap 3.0.2 -->
    <link href="/resource/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
    <!-- font Awesome -->
    <link href="/resource/css/font-awesome.min.css" rel="stylesheet" type="text/css" />
    <!-- Ionicons -->
    <link href="/resource/css/ionicons.min.css" rel="stylesheet" type="text/css" />
    <!-- Morris chart -->
    <link href="/resource/css/morris/morris.css" rel="stylesheet" type="text/css" />
    <!-- jvectormap -->
    <link href="/resource/css/jvectormap/jquery-jvectormap-1.2.2.css" rel="stylesheet" type="text/css" />
    <!-- Theme style -->
    <link href="/resource/css/style.css" rel="stylesheet" type="text/css" />
</head>

<body class="skin-black">
	<!-- header logo: style can be found in header.less -->
    <header class="header">
        <a href="/admin/toIndex" class="logo">
            <img src="/resource/img/logo.png" />
        </a>
        <!-- Header Navbar: style can be found in header.less -->
        <nav class="navbar navbar-static-top" role="navigation">
            <!-- Sidebar toggle button-->
            <a href="#" class="navbar-btn sidebar-toggle" data-toggle="offcanvas" role="button">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </a>
            <div class="navbar-right">
                <ul class="nav navbar-nav">
                    <!-- User Account: style can be found in dropdown.less -->
                    <li class="dropdown user user-menu">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                            <i class="fa fa-user"></i>
                            <span><font id="user-name"></font> <i class="caret"></i></span>
                        </a>
                        <ul class="dropdown-menu dropdown-custom dropdown-menu-right">
                            <li class="dropdown-header text-center">用户中心</li>

                            <li>
                                <a href="/index" target="_blank"><i class="fa fa-home pull-right"></i> 网站首页</a>
                            </li>

                            <li class="divider"></li>
                            <li>
                                <a href="#">
                                	<i class="fa fa-user fa-fw pull-right"></i>
                                    Profile
                                </a>
                                <a data-toggle="modal" href="#modal-user-settings">
                                	<i class="fa fa-cog fa-fw pull-right"></i>
                                    Settings
                                </a>
                            </li>
                            <li class="divider"></li>

                            <li>
                                <a href="javascript:void(0)" onclick="logout();"><i class="fa fa-sign-out pull-right"></i> 退出登录</a>
                            </li>
                        </ul>
                    </li>
                </ul>
            </div>
        </nav>
    </header>
            <div class="wrapper row-offcanvas row-offcanvas-left">
                <!-- Left side column. contains the logo and sidebar -->
                <aside class="left-side sidebar-offcanvas">
                    <!-- sidebar: style can be found in sidebar.less -->
                    <section class="sidebar">
                        <!-- search form -->
                        <form action="#" method="get" class="sidebar-form">
                            <div class="input-group">
                                <input type="text" name="q" class="form-control" placeholder="Search..."/>
                                <span class="input-group-btn">
                                    <button type='submit' name='seach' id='search-btn' class="btn btn-flat"><i class="fa fa-search"></i></button>
                                </span>
                            </div>
                        </form>
                        <!-- /.search form -->
                        <!-- sidebar menu: : style can be found in sidebar.less -->
                        <ul class="sidebar-menu">
							<li class="active">
                                <a href="/admin/dashboard/toIndex" target="mainframe" class="waves-effect waves-dark"><i class="fa fa-dashboard"></i>仪表盘</a>
                            </li>
                            <li>
                                <a href="/admin/archives/list" target="mainframe" class="waves-effect waves-dark"><i class="fa fa-pencil-square-o"></i>文章管理</a>
                            </li>
							<li>
		                        <a href="/admin/category/list" target="mainframe" class="waves-effect waves-dark"><i class="fa fa-columns"></i>栏目管理</a>
		                    </li>
		                    <li>
		                        <a href="/admin/label/toIndex" target="mainframe" class="waves-effect waves-dark"><i class="fa fa-tags"></i>标签管理</a>
		                    </li>
		                    <li>
		                        <a href="/admin/pages/list" target="mainframe" class="waves-effect waves-dark"><i class="fa fa-code"></i>页面管理</a>
		                    </li>
		                    <li>
		                        <a href="/admin/forms/list" target="mainframe" class="waves-effect waves-dark"><i class="fa fa-check-square-o"></i>表单管理</a>
		                    </li>
		                    <li>
		                        <a href="/admin/attachment/list" target="mainframe" class="waves-effect waves-dark"><i class="fa fa-chain"></i>附件管理</a>
		                    </li>
		                    <li>
		                        <a href="/admin/theme/list" target="mainframe" class="waves-effect waves-dark"><i class="fa fa-puzzle-piece"></i>风格设置</a>
		                    </li>
		                    <li>
		                        <a href="/admin/variable/list" target="mainframe" class="waves-effect waves-dark"><i class="fa fa-cog"></i>变量管理</a>
		                    </li>
		                    <li>
		                        <a href="/admin/system/toIndex" target="mainframe" class="waves-effect waves-dark"><i class="fa fa-cog"></i>系统配置</a>
		                    </li>
                        </ul>
                    </section>
                    <!-- /.sidebar -->
                </aside>
                <aside class="right-side">
            <!-- Main content -->
            <section class="content">
				<iframe id="mainframe" name="mainframe" style="width:100%; border:0;" src="/admin/system/toIndex"></iframe>
            </section><!-- /.content -->
            <div class="footer-main">
                Copyright &copy Dreamer Blog, Powered by www.itechyou.cn 2018-2030
            </div>
        </aside><!-- /.right-side -->

    </div><!-- ./wrapper -->


	<!-- jQuery 2.0.2 -->
	<script src="/resource/js/jquery.min.js" type="text/javascript"></script>
	<!-- jQuery UI 1.10.3 -->
	<script src="/resource/js/jquery-ui-1.10.3.min.js" type="text/javascript"></script>
	<!-- Bootstrap -->
	<script src="/resource/js/bootstrap.min.js" type="text/javascript"></script>
	<!-- Director App -->
	<script src="/resource/js/Director/app.js" type="text/javascript"></script>

	<script type="text/javascript">
		$(function () {
			  iframeAutoHeight();
			  
			  $(".sidebar-menu li").click(function(){
				  $(".sidebar-menu li").removeClass("active");
				  $(this).addClass("active");
			  });
			  
			  var userStr = sessionStorage.getItem("dreamer-blog-user");
			  if(userStr == null || userStr == "" || userStr == "undefined"){
				  window.location.href = "/admin/toLogin";
			  }else{
				  var user = JSON.parse(userStr);
				  $("#user-name").text(user.realname);
			  }
		});
		
		function iframeAutoHeight() {
		    var headerH = $(".header").height();
		    var footerH = $(".footer-main").height() + 15;
		    var sectionH = 45;
		    var bodyerH = $(window).height() - headerH - footerH - sectionH;
		    $("iframe#mainframe").height(bodyerH);
		}
		
		//退出登录
		function logout(){
			sessionStorage.removeItem("dreamer-blog-user");
			console.log("fdsafdwas");
			window.location.href = "/admin/logout";
		}
	</script>
</body>
</html>